*------------------------------------------------------------------------------*
* Family history - Dinas, Fouka, Schläpfer - JoP
*------------------------------------------------------------------------------*

*------------------------------------------------------------------------------*
* Table 1
*------------------------------------------------------------------------------*



*------------------------------------------------------------------------------*
* Greece
*------------------------------------------------------------------------------*

use greece, clear

local treatment T
local controls female i.age i.edu i.occupation i.income i.nomos 
estimates clear
foreach x in pc_behst pc_all_bst {
	reg `x' asiaminor##T, cl(municipality)
	eststo m_`x'
	reg `x' asiaminor##T `controls', cl(municipality)
	eststo m_`x'_c
}
esttab m* using "Table1_GR.html", star(+ 0.1 * 0.05 ** 0.01) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2)  ///
		keep(1.asiaminor 1.T 1.asiaminor#1.T)

gen asia_T=asiaminor*T
gen nonasia_T=(1-asiaminor)*T


*last line of table
estimates clear
foreach x in pc_behst pc_all_bst {
	reg `x' asiaminor nonasia_T asia_T, cl(municipality)
	eststo m_`x'
	reg `x' asiaminor nonasia_T asia_T  `controls', cl(municipality)
	eststo m_`x'_c
}
esttab m* using "Table1_GR_addline.html", star(+ 0.1 * 0.05 ** 0.01) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2)  ///
		keep(asia_T)
		
*------------------------------------------------------------------------------*
* Germany
*------------------------------------------------------------------------------*

use germany, clear


local treatment t1
local controls i.sex i.state i.age i.F4 i.F13
estimates clear
foreach x in donate_st pc_att {
	reg `x' expellee##t1, cl(GKZ)
	eststo m_`x'
	reg `x' expellee##t1 `controls', cl(GKZ)
	eststo m_`x'_c
}

esttab m* using "Table1_DE.html", star(+ 0.1 * 0.05 ** 0.01) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2)  ///
		keep(1.expellee 1.t1 1.expellee#1.t1)
		

gen expellee_T=expellee*t1
gen nonexpellee_T=(1-expellee)*t1

estimates clear
foreach x in donate_st pc_att {
	reg `x' expellee nonexpellee_T expellee_T, cl(GKZ)
	eststo m_`x'
	reg `x' expellee nonexpellee_T expellee_T `controls', cl(GKZ)
	eststo m_`x'_c
}
esttab m* using "Table1_DE_addline.html", star(+ 0.1 * 0.05 ** 0.01) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2)  ///
		keep(expellee_T)
